package com.lagou.homework.part04

import akka.actor.{Actor, ActorRef, ActorSystem, Props}

import scala.io.StdIn

/**
 * @author: yehw
 * @date: 2020/10/9 23:08
 * @description: ${TOD}
 */
object part04 {
  //通过ActorSystem创建线程池对象myFactory
  private val myFactory = ActorSystem("myFactory")
  //通过myFactory.actorOf来创建一个Actor
  private val aActor: ActorRef = myFactory.actorOf(Props[AActor], "aActor")
  private val bActor: ActorRef = myFactory.actorOf(Props(new BActor(aActor)), "bActor")
  def main(args: Array[String]): Unit = {
    bActor!"AActor 出招类。。。"
  }
}
